<?php 
picture_category::$_lang = $this->user->getLang();
if(!function_exists('_categoryTree')) {
	function _categoryTree($obj, $tree) {
		$str = "";
		foreach((array) $tree AS $row) {
			$url = $obj->url('picture/special/list', array(), array('category_id' => $row['id']));
			$str .= '<ul class="sub">';
			$str .= '<li><a href="' . $url . '">' . $row['title'] . '</a>';
			$str .= '[<em>' . $row['id'] . '</em>](<em class="red">' . $row['stotal'] . '</em>)';
			if(!empty($row['children'])) {
				$str .= _categoryTree($obj, $row['children']);
			}
			$str .= '</li></ul>';
		}
		return $str;
	}
}
?><div class="body">
	<div class="msg">
		<div class="common helper">
			<i class="icon"></i><h4><?php echo $this->language('SPECIAL MANAGEMENT')?>:</h4>
			<div class="msg-bd">
				<ul class="guide">
					<li><a href="<?php echo $this->url('picture/import/special');?>"><?php echo $this->language('Import Special from other language')?> »</a></li>
					<li>
						<a href="<?php echo $this->url('picture/special/list');?>"><?php echo $this->language('All Special List')?> »</a>						
						<?php echo _categoryTree($this, picture_category::allCategoryToTreeAsArray());?>
					</li>
					<li>
						<a href="<?php echo $this->url('picture/special/recommend');?>"><?php echo $this->language('Recommended Special List')?> »</a>
						<ul class="sub">
						<?php
							$concept = new picture_special_regroup_concept($this->user->getLang());
							foreach($concept->fetchAll() AS $row) {
						?>
						<li><a href="<?php echo $this->url('picture/special/recommend', array(), array('group_id' => $row->getId()));?>"><?php echo $this->escape($row->getDescription());?></a></li>
						<?php } ?>
						</ul>
					</li>
					<li><a href="<?php echo $this->url('picture/special/regroup');?>"><?php echo $this->language('Recommend Group Management')?> »</a></li>
					<li><a href="<?php echo $this->url('picture/special/list', array(), array('filter' => 'isolated'));?>"><?php echo $this->language('Isolated Special List')?> »</a></li>
				</ul>
				<br/>
			</div>
		</div>	
	</div>	
</div>